Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wrote/read

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wrote/read

Read the contents of file from the filesystem.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@wrote/read

npm version

@wrote/read is a package to read a file as a string or a Buffer.

yarn add -E @wrote/read

Table Of Contents

API

The package is available by importing its default function read, and named function readBuffer:

import read, { readBuffer } from '@wrote/read'

async read(
  path: string,
): string

Read the file as a string.

/* yarn example/ */
import read from '@wrote/read'

(async () => {
  const res = await read('example/data.txt')
  console.log(res)
})()
Hello World

async readBuffer(
  path: string,
): Buffer

Read the file as a Buffer.

/* yarn example/ */
import { readBuffer } from '@wrote/read'

(async () => {
  const res = await readBuffer('example/data.txt')
  console.log(res)
})()
<Buffer 48 65 6c 6c 6f 20 57 6f 72 6c 64>

Art Deco © Art Deco for Wrote 2019 Wrote Tech Nation Visa Tech Nation Visa Sucks

Keywords

FAQs

Package last updated on 10 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc